x = 300


def mytest1():
    x = 200

    def test2():
        global x
        print("----1-----x=%d" % x)
        x = 100
        print("----2-----x=%d" % x)

    return test2


t1 = mytest1()
t1()
# 输出
# ----1-----x=300
# ----2-----x=100